package com.example.androiddemo;

import com.example.androiddemo.entities.MediaInfo;
import com.example.androiddemo.grid.GridViewAndRelateLayoutActivity;
import com.example.androiddemo.grid.GridViewForUniversalImageLoaderActivity;
import com.lidroid.xutils.DbUtils;
import com.lidroid.xutils.exception.DbException;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;

public class MainActivity extends Activity {

	private Button gridViewTestBtn;
	
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        gridViewTestBtn = (Button) findViewById(R.id.gridViewTestBtn);
        gridViewTestBtn.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				
//				DbUtils db = DbUtils.create(MainActivity.this);
//	            db.configAllowTransaction(true);
//	            db.configDebug(true);
//	            try {
//					db.deleteAll(MediaInfo.class);
//				} catch (DbException e) {
//					// TODO Auto-generated catch block
//					e.printStackTrace();
//				}
	            Intent intent = new Intent(MainActivity.this, GridViewForUniversalImageLoaderActivity.class);
				startActivity(intent);
			}
		});
    }
}
